﻿// <copyright file="Fallout3Mod.cs" company="SingularityShift">
// Copyright (c) 2009 SingularityShift.com
// </copyright>
// <author>Ben McClure</author>
// <email>ben@singularityshift.com</email>
// <date>2009-08-14</date>
// <summary>An extension of AbstractMod, this describes a mod for the game Fallout 3.</summary>
namespace GameLib.Games.Fallout3
{
    using System;
    using GameLib.Games;
    using GameLib.Games.Util;

    /// <summary>
    /// An object representing a single mod (ESP or ESM) for Fallout 3. This is the primary mod type of a Fallout3Game object.
    /// </summary>
    [Serializable()]
    public class Fallout3Mod : AbstractMod, IMod
    {
        /// <summary>
        /// Initializes a new instance of the Fallout3Mod class.
        /// </summary>
        /// <param name="owner">The IGame which owns this mod</param>
        public Fallout3Mod(IGame<Fallout3Mod> owner)
        {
            Owner = owner;
        }

        /// <summary>
        /// Initializes a new instance of the Fallout3Mod class.
        /// </summary>
        /// <param name="owner">The IGame which owns this mod</param>
        /// <param name="id">The mod's Id string</param>
        public Fallout3Mod(IGame<Fallout3Mod> owner, string id)
            : this(owner)
        {
            Id = id;
        }

        /// <summary>
        /// Initializes a new instance of the Fallout3Mod class.
        /// </summary>
        /// <param name="owner">The IGame which owns this mod</param>
        /// <param name="id">The mod's Id string</param>
        /// <param name="title">A title for the mod</param>
        public Fallout3Mod(IGame<Fallout3Mod> owner, string id, string title)
            : this(owner, id)
        {
            Name = title;
        }

        /// <summary>
        /// Initializes a new instance of the Fallout3Mod class.
        /// </summary>
        /// <param name="owner">The IGame which owns this mod</param>
        /// <param name="id">The mod's Id string</param>
        /// <param name="title">A title for the mod</param>
        /// <param name="file">The file path or filename for the mod</param>
        public Fallout3Mod(IGame<Fallout3Mod> owner, string id, string title, string file)
            : this(owner, id, title)
        {
            this.File = file;
        }

        /// <summary>
        /// Initializes a new instance of the Fallout3Mod class for cloning or deserialization.
        /// </summary>
        public Fallout3Mod()
        {
        }

        /// <summary>
        /// Gets or sets a value indicating whether this mod requires FOSE (The Fallout 3 Script Extender) to be installed.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Fose", Justification = "FOSE is a valid Fallout 3 term")]
        public bool RequiresFose
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets an FoseVersion struct indicating the required FOSE version.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Fose", Justification = "FOSE is a valid Fallout 3 term")]
        public FoseVersion RequiredFoseVersion
        {
            get;
            set;
        }

        public override ModStates State
        {
            get
            {
                return GetState<Fallout3Mod>();
            }
        }
    }
}